package com.tuozixuan.junit.constant;

public enum StatusEnum {

	DISABLE(0, "禁用"), 
	
	ENABLE(1, "啓用"),

	WAIT_ENABLE(2, "待啓用");

	private int value;

	private String desc;

	public int getValue() {
		return value;
	}

	public String getDesc() {
		return desc;
	}

	StatusEnum(int value, String desc) {
		this.value = value;
		this.desc = desc;
	}
	
	public static StatusEnum getEnum(int value) {
		StatusEnum status = null;
		for (StatusEnum item : StatusEnum.values()) {
			if (item.getValue() == value) {
				status = item;
				break;
			}
		}
		return status;
	}

	public static String getDesc(int value) {
		String desc = null;
		for (StatusEnum item : StatusEnum.values()) {
			if (item.getValue() == value) {
				desc = item.getDesc();
				break;
			}
		}
		return desc;
	}
}
